<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-- Copyright 2016 TensorFlow authors.</span><span>
</span><span id="line-2"></span><span class="hs-comment">--</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- you may not use this file except in compliance with the License.</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- You may obtain a copy of the License at</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">--     http://www.apache.org/licenses/LICENSE-2.0</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Unless required by applicable law or agreed to in writing, software</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- See the License for the specific language governing permissions and</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- limitations under the License.</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-pragma">{-# LANGUAGE DataKinds #-}</span><span>
</span><span id="line-16"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-17"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-18"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-19"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-20"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-21"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-22"></span><span class="hs-pragma">{-# LANGUAGE TypeOperators #-}</span><span>
</span><span id="line-23"></span><span class="hs-pragma">{-# LANGUAGE UndecidableInstances #-}</span><span>  </span><span class="hs-comment">-- For Fetchable (TensorExpr a)</span><span>
</span><span id="line-24"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">TensorFlow.Nodes</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Control.Applicative</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">liftA2</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">liftA3</span></span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Functor.Identity</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Identity</span></span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Map.Strict</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Map</span></span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Set</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Set</span></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Text</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Text</span></span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Map.Strict</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Set</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Build.html"><span class="hs-identifier">TensorFlow.Build</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Output.html"><span class="hs-identifier">TensorFlow.Output</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Tensor.html"><span class="hs-identifier">TensorFlow.Tensor</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Types.html"><span class="hs-identifier">TensorFlow.Types</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="TensorFlow.Internal.FFI.html"><span class="hs-identifier">TensorFlow.Internal.FFI</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">FFI</span></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-comment">-- | Types that contain ops which can be run.</span><span>
</span><span id="line-41"></span><span class="hs-keyword">class</span><span> </span><span id="Nodes"><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-var">Nodes</span></a></span></span><span> </span><span id="local-6989586621679166546"><span class="annot"><a href="#local-6989586621679166546"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-42"></span><span>    </span><span id="getNodes"><span class="annot"><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-type">getNodes</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679166546"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Set</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-comment">-- | Types that tensor representations (e.g. 'Tensor', 'ControlNode') can be</span><span>
</span><span id="line-45"></span><span class="hs-comment">-- fetched into.</span><span>
</span><span id="line-46"></span><span class="hs-comment">--</span><span>
</span><span id="line-47"></span><span class="hs-comment">-- Includes collections of tensors (e.g. tuples).</span><span>
</span><span id="line-48"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166534"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Fetchable"><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-var">Fetchable</span></a></span></span><span> </span><span id="local-6989586621679166534"><span class="annot"><a href="#local-6989586621679166534"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span id="local-6989586621679166533"><span class="annot"><a href="#local-6989586621679166533"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-49"></span><span>    </span><span id="getFetch"><span class="annot"><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-type">getFetch</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679166534"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166533"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- | Fetch action. Keeps track of what needs to be fetched and how to decode</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- the fetched data.</span><span>
</span><span id="line-53"></span><span class="hs-keyword">data</span><span> </span><span id="Fetch"><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span></span><span> </span><span id="local-6989586621679166590"><span class="annot"><a href="#local-6989586621679166590"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Fetch"><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span></span><span>
</span><span id="line-54"></span><span>          </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- | Nodes to fetch</span><span>
</span><span id="line-55"></span><span>            </span><span id="fetches"><span class="annot"><span class="annottext">Fetch a -&gt; Set Text
</span><a href="TensorFlow.Nodes.html#fetches"><span class="hs-identifier hs-var hs-var">fetches</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Set</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span>
</span><span id="line-56"></span><span>            </span><span class="hs-comment">-- | Function to create an 'a' from the fetched data.</span><span>
</span><span id="line-57"></span><span>          </span><span class="hs-special">,</span><span> </span><span id="fetchRestore"><span class="annot"><span class="annottext">Fetch a -&gt; Map Text TensorData -&gt; a
</span><a href="TensorFlow.Nodes.html#fetchRestore"><span class="hs-identifier hs-var hs-var">fetchRestore</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Map</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span> </span><span class="annot"><a href="TensorFlow.Internal.FFI.html#TensorData"><span class="hs-identifier hs-type">FFI.TensorData</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679166590"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-58"></span><span>          </span><span class="hs-special">}</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679166427"><span class="annot"><span class="hs-identifier hs-type">Functor</span></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>    </span><span id="local-6989586621679166425"><span class="annot"><span class="annottext">fmap :: (a -&gt; b) -&gt; Fetch a -&gt; Fetch b
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></span></span><span> </span><span id="local-6989586621679166424"><span class="annot"><span class="annottext">f :: a -&gt; b
</span><a href="#local-6989586621679166424"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span id="local-6989586621679166423"><span class="annot"><span class="annottext">fetch :: Set Text
</span><a href="#local-6989586621679166423"><span class="hs-identifier hs-var">fetch</span></a></span></span><span> </span><span id="local-6989586621679166422"><span class="annot"><span class="annottext">restore :: Map Text TensorData -&gt; a
</span><a href="#local-6989586621679166422"><span class="hs-identifier hs-var">restore</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Text -&gt; (Map Text TensorData -&gt; b) -&gt; Fetch b
forall a. Set Text -&gt; (Map Text TensorData -&gt; a) -&gt; Fetch a
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="annot"><span class="annottext">Set Text
</span><a href="#local-6989586621679166423"><span class="hs-identifier hs-var">fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679166424"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; (Map Text TensorData -&gt; a) -&gt; Map Text TensorData -&gt; b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">Map Text TensorData -&gt; a
</span><a href="#local-6989586621679166422"><span class="hs-identifier hs-var">restore</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679166412"><span id="local-6989586621679166414"><span id="local-6989586621679166416"><span class="annot"><span class="hs-identifier hs-type">Applicative</span></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-64"></span><span>    </span><span id="local-6989586621679166410"><span class="annot"><span class="annottext">pure :: a -&gt; Fetch a
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></span></span><span> </span><span id="local-6989586621679166409"><span class="annot"><span class="annottext">x :: a
</span><a href="#local-6989586621679166409"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Text -&gt; (Map Text TensorData -&gt; a) -&gt; Fetch a
forall a. Set Text -&gt; (Map Text TensorData -&gt; a) -&gt; Fetch a
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="annot"><span class="annottext">Set Text
forall a. Set a
</span><span class="hs-identifier hs-var">Set.empty</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Map Text TensorData -&gt; a
forall a b. a -&gt; b -&gt; a
</span><span class="hs-identifier hs-var">const</span></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679166409"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>    </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span id="local-6989586621679166406"><span class="annot"><span class="annottext">fetch :: Set Text
</span><a href="#local-6989586621679166406"><span class="hs-identifier hs-var">fetch</span></a></span></span><span> </span><span id="local-6989586621679166405"><span class="annot"><span class="annottext">restore :: Map Text TensorData -&gt; a -&gt; b
</span><a href="#local-6989586621679166405"><span class="hs-identifier hs-var">restore</span></a></span></span><span> </span><span id="local-6989586621679166404"><span class="annot"><span class="annottext">&lt;*&gt; :: Fetch (a -&gt; b) -&gt; Fetch a -&gt; Fetch b
</span><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></span></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span id="local-6989586621679166403"><span class="annot"><span class="annottext">fetch' :: Set Text
</span><a href="#local-6989586621679166403"><span class="hs-identifier hs-var">fetch'</span></a></span></span><span> </span><span id="local-6989586621679166402"><span class="annot"><span class="annottext">restore' :: Map Text TensorData -&gt; a
</span><a href="#local-6989586621679166402"><span class="hs-identifier hs-var">restore'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-66"></span><span>        </span><span class="annot"><span class="annottext">Set Text -&gt; (Map Text TensorData -&gt; b) -&gt; Fetch b
forall a. Set Text -&gt; (Map Text TensorData -&gt; a) -&gt; Fetch a
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set Text
</span><a href="#local-6989586621679166406"><span class="hs-identifier hs-var">fetch</span></a></span><span> </span><span class="annot"><span class="annottext">Set Text -&gt; Set Text -&gt; Set Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span> </span><span class="annot"><span class="annottext">Set Text
</span><a href="#local-6989586621679166403"><span class="hs-identifier hs-var">fetch'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map Text TensorData -&gt; a -&gt; b
</span><a href="#local-6989586621679166405"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="annot"><span class="annottext">(Map Text TensorData -&gt; a -&gt; b)
-&gt; (Map Text TensorData -&gt; a) -&gt; Map Text TensorData -&gt; b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;*&gt;</span></span><span> </span><span class="annot"><span class="annottext">Map Text TensorData -&gt; a
</span><a href="#local-6989586621679166402"><span class="hs-identifier hs-var">restore'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span id="local-6989586621679166543"><span id="local-6989586621679166544"><span id="local-6989586621679166545"><span class="annot"><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-type">nodesUnion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Monoid</span></span><span> </span><span class="annot"><a href="#local-6989586621679166545"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Traversable</span></span><span> </span><span class="annot"><a href="#local-6989586621679166544"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Applicative</span></span><span> </span><span class="annot"><a href="#local-6989586621679166543"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679166544"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166543"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166545"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679166543"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166545"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-69"></span><span id="nodesUnion"><span class="annot"><span class="annottext">nodesUnion :: t (f b) -&gt; f b
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var hs-var">nodesUnion</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(t b -&gt; b) -&gt; f (t b) -&gt; f b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; b) -&gt; t b -&gt; b
forall (t :: * -&gt; *) m a.
(Foldable t, Monoid m) =&gt;
(a -&gt; m) -&gt; t a -&gt; m
</span><span class="hs-identifier hs-var">foldMap</span></span><span> </span><span class="annot"><span class="annottext">b -&gt; b
forall a. a -&gt; a
</span><span class="hs-identifier hs-var">id</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(f (t b) -&gt; f b) -&gt; (t (f b) -&gt; f (t b)) -&gt; t (f b) -&gt; f b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">t (f b) -&gt; f (t b)
forall (t :: * -&gt; *) (f :: * -&gt; *) a.
(Traversable t, Applicative f) =&gt;
t (f a) -&gt; f (t a)
</span><span class="hs-identifier hs-var">sequenceA</span></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span id="local-6989586621679166396"><span id="local-6989586621679166397"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166397"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166396"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166397"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166396"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-72"></span><span>    </span><span id="local-6989586621679166393"><span class="annot"><span class="annottext">getNodes :: (t1, t2) -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166393"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166392"><span class="annot"><span class="annottext">x :: t1
</span><a href="#local-6989586621679166392"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166391"><span class="annot"><span class="annottext">y :: t2
</span><a href="#local-6989586621679166391"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Build (Set NodeName)] -&gt; Build (Set NodeName)
forall b (t :: * -&gt; *) (f :: * -&gt; *).
(Monoid b, Traversable t, Applicative f) =&gt;
t (f b) -&gt; f b
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">t1 -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t1
</span><a href="#local-6989586621679166392"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t2 -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t2
</span><a href="#local-6989586621679166391"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span id="local-6989586621679166388"><span id="local-6989586621679166389"><span id="local-6989586621679166390"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166390"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166389"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166388"><span class="hs-identifier hs-type">t3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166390"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166389"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166388"><span class="hs-identifier hs-type">t3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-75"></span><span>    </span><span id="local-6989586621679166386"><span class="annot"><span class="annottext">getNodes :: (t1, t2, t3) -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166386"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166385"><span class="annot"><span class="annottext">x :: t1
</span><a href="#local-6989586621679166385"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166384"><span class="annot"><span class="annottext">y :: t2
</span><a href="#local-6989586621679166384"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166383"><span class="annot"><span class="annottext">z :: t3
</span><a href="#local-6989586621679166383"><span class="hs-identifier hs-var">z</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Build (Set NodeName)] -&gt; Build (Set NodeName)
forall b (t :: * -&gt; *) (f :: * -&gt; *).
(Monoid b, Traversable t, Applicative f) =&gt;
t (f b) -&gt; f b
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">t1 -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t1
</span><a href="#local-6989586621679166385"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t2 -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t2
</span><a href="#local-6989586621679166384"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t3 -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t3
</span><a href="#local-6989586621679166383"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">]</span></span></span></span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span id="local-6989586621679166379"><span id="local-6989586621679166380"><span id="local-6989586621679166381"><span id="local-6989586621679166382"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166382"><span class="hs-identifier hs-type">t1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166381"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166380"><span class="hs-identifier hs-type">t2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166379"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166382"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166380"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166381"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166379"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-78"></span><span>    </span><span id="local-6989586621679166375"><span class="annot"><span class="annottext">getFetch :: (t1, t2) -&gt; Build (Fetch (a1, a2))
</span><a href="#local-6989586621679166375"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166374"><span class="annot"><span class="annottext">x :: t1
</span><a href="#local-6989586621679166374"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166373"><span class="annot"><span class="annottext">y :: t2
</span><a href="#local-6989586621679166373"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a1 -&gt; a2 -&gt; (a1, a2)) -&gt; Fetch a1 -&gt; Fetch a2 -&gt; Fetch (a1, a2)
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><span class="hs-identifier hs-var">liftA2</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Fetch a1 -&gt; Fetch a2 -&gt; Fetch (a1, a2))
-&gt; BuildT Identity (Fetch a1)
-&gt; BuildT Identity (Fetch a2 -&gt; Fetch (a1, a2))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">t1 -&gt; BuildT Identity (Fetch a1)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t1
</span><a href="#local-6989586621679166374"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch a2 -&gt; Fetch (a1, a2))
-&gt; BuildT Identity (Fetch a2) -&gt; Build (Fetch (a1, a2))
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;*&gt;</span></span><span> </span><span class="annot"><span class="annottext">t2 -&gt; BuildT Identity (Fetch a2)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t2
</span><a href="#local-6989586621679166373"><span class="hs-identifier hs-var">y</span></a></span></span></span></span></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span id="local-6989586621679166366"><span id="local-6989586621679166367"><span id="local-6989586621679166368"><span id="local-6989586621679166369"><span id="local-6989586621679166370"><span id="local-6989586621679166371"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166371"><span class="hs-identifier hs-type">t1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166370"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166369"><span class="hs-identifier hs-type">t2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166368"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166367"><span class="hs-identifier hs-type">t3</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166366"><span class="hs-identifier hs-type">a3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span>         </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166371"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166369"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166367"><span class="hs-identifier hs-type">t3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166370"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166368"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166366"><span class="hs-identifier hs-type">a3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-82"></span><span>    </span><span id="local-6989586621679166363"><span class="annot"><span class="annottext">getFetch :: (t1, t2, t3) -&gt; Build (Fetch (a1, a2, a3))
</span><a href="#local-6989586621679166363"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166362"><span class="annot"><span class="annottext">x :: t1
</span><a href="#local-6989586621679166362"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166361"><span class="annot"><span class="annottext">y :: t2
</span><a href="#local-6989586621679166361"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166360"><span class="annot"><span class="annottext">z :: t3
</span><a href="#local-6989586621679166360"><span class="hs-identifier hs-var">z</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-83"></span><span>        </span><span class="annot"><span class="annottext">(a1 -&gt; a2 -&gt; a3 -&gt; (a1, a2, a3))
-&gt; Fetch a1 -&gt; Fetch a2 -&gt; Fetch a3 -&gt; Fetch (a1, a2, a3)
forall (f :: * -&gt; *) a b c d.
Applicative f =&gt;
(a -&gt; b -&gt; c -&gt; d) -&gt; f a -&gt; f b -&gt; f c -&gt; f d
</span><span class="hs-identifier hs-var">liftA3</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Fetch a1 -&gt; Fetch a2 -&gt; Fetch a3 -&gt; Fetch (a1, a2, a3))
-&gt; BuildT Identity (Fetch a1)
-&gt; BuildT Identity (Fetch a2 -&gt; Fetch a3 -&gt; Fetch (a1, a2, a3))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">t1 -&gt; BuildT Identity (Fetch a1)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t1
</span><a href="#local-6989586621679166362"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch a2 -&gt; Fetch a3 -&gt; Fetch (a1, a2, a3))
-&gt; BuildT Identity (Fetch a2)
-&gt; BuildT Identity (Fetch a3 -&gt; Fetch (a1, a2, a3))
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;*&gt;</span></span><span> </span><span class="annot"><span class="annottext">t2 -&gt; BuildT Identity (Fetch a2)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t2
</span><a href="#local-6989586621679166361"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch a3 -&gt; Fetch (a1, a2, a3))
-&gt; BuildT Identity (Fetch a3) -&gt; Build (Fetch (a1, a2, a3))
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;*&gt;</span></span><span> </span><span class="annot"><span class="annottext">t3 -&gt; BuildT Identity (Fetch a3)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t3
</span><a href="#local-6989586621679166360"><span class="hs-identifier hs-var">z</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span id="local-6989586621679166359"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166359"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679166359"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-86"></span><span>    </span><span id="local-6989586621679166357"><span class="annot"><span class="annottext">getNodes :: [t] -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166357"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Build (Set NodeName)] -&gt; Build (Set NodeName)
forall b (t :: * -&gt; *) (f :: * -&gt; *).
(Monoid b, Traversable t, Applicative f) =&gt;
t (f b) -&gt; f b
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="annot"><span class="annottext">([Build (Set NodeName)] -&gt; Build (Set NodeName))
-&gt; ([t] -&gt; [Build (Set NodeName)]) -&gt; [t] -&gt; Build (Set NodeName)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">(t -&gt; Build (Set NodeName)) -&gt; [t] -&gt; [Build (Set NodeName)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><span class="hs-identifier hs-var">map</span></span><span> </span><span class="annot"><span class="annottext">t -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span id="local-6989586621679166355"><span id="local-6989586621679166356"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166356"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166355"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679166356"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679166355"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-89"></span><span>    </span><span id="local-6989586621679166352"><span class="annot"><span class="annottext">getFetch :: [t] -&gt; Build (Fetch [a])
</span><a href="#local-6989586621679166352"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span id="local-6989586621679166351"><span class="annot"><span class="annottext">ts :: [t]
</span><a href="#local-6989586621679166351"><span class="hs-identifier hs-var">ts</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Fetch a] -&gt; Fetch [a]
forall (t :: * -&gt; *) (f :: * -&gt; *) a.
(Traversable t, Applicative f) =&gt;
t (f a) -&gt; f (t a)
</span><span class="hs-identifier hs-var">sequenceA</span></span><span> </span><span class="annot"><span class="annottext">([Fetch a] -&gt; Fetch [a])
-&gt; BuildT Identity [Fetch a] -&gt; Build (Fetch [a])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">(t -&gt; BuildT Identity (Fetch a))
-&gt; [t] -&gt; BuildT Identity [Fetch a]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><span class="hs-identifier hs-var">mapM</span></span><span> </span><span class="annot"><span class="annottext">t -&gt; BuildT Identity (Fetch a)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679166351"><span class="hs-identifier hs-var">ts</span></a></span></span></span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span id="local-6989586621679166349"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166349"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="#local-6989586621679166349"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-92"></span><span>    </span><span id="local-6989586621679166347"><span class="annot"><span class="annottext">getNodes :: Maybe t -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166347"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Build (Set NodeName)) -&gt; Build (Set NodeName)
forall b (t :: * -&gt; *) (f :: * -&gt; *).
(Monoid b, Traversable t, Applicative f) =&gt;
t (f b) -&gt; f b
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Build (Set NodeName)) -&gt; Build (Set NodeName))
-&gt; (Maybe t -&gt; Maybe (Build (Set NodeName)))
-&gt; Maybe t
-&gt; Build (Set NodeName)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">(t -&gt; Build (Set NodeName))
-&gt; Maybe t -&gt; Maybe (Build (Set NodeName))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="annot"><span class="annottext">t -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span></span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span id="local-6989586621679166345"><span id="local-6989586621679166346"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166346"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166345"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="#local-6989586621679166346"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="#local-6989586621679166345"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-95"></span><span>    </span><span id="local-6989586621679166342"><span class="annot"><span class="annottext">getFetch :: Maybe t -&gt; Build (Fetch (Maybe a))
</span><a href="#local-6989586621679166342"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe (Fetch a) -&gt; Fetch (Maybe a))
-&gt; BuildT Identity (Maybe (Fetch a)) -&gt; Build (Fetch (Maybe a))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="annot"><span class="annottext">Maybe (Fetch a) -&gt; Fetch (Maybe a)
forall (t :: * -&gt; *) (f :: * -&gt; *) a.
(Traversable t, Applicative f) =&gt;
t (f a) -&gt; f (t a)
</span><span class="hs-identifier hs-var">sequenceA</span></span><span> </span><span class="annot"><span class="annottext">(BuildT Identity (Maybe (Fetch a)) -&gt; Build (Fetch (Maybe a)))
-&gt; (Maybe t -&gt; BuildT Identity (Maybe (Fetch a)))
-&gt; Maybe t
-&gt; Build (Fetch (Maybe a))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">(t -&gt; BuildT Identity (Fetch a))
-&gt; Maybe t -&gt; BuildT Identity (Maybe (Fetch a))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><span class="hs-identifier hs-var">mapM</span></span><span> </span><span class="annot"><span class="annottext">t -&gt; BuildT Identity (Fetch a)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span></span></span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-98"></span><span>    </span><span id="local-6989586621679166340"><span class="annot"><span class="annottext">getNodes :: ControlNode -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166340"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span id="local-6989586621679166338"><span class="annot"><span class="annottext">o :: NodeName
</span><a href="#local-6989586621679166338"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set NodeName -&gt; Build (Set NodeName)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="annot"><span class="annottext">(Set NodeName -&gt; Build (Set NodeName))
-&gt; Set NodeName -&gt; Build (Set NodeName)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Set NodeName
forall a. a -&gt; Set a
</span><span class="hs-identifier hs-var">Set.singleton</span></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679166338"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span class="hs-comment">-- We use the constraint @(a ~ ())@ to help with type inference.  For example,</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- if @t :: ControlNode@, then this constraint ensures that @run t :: Session</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- ()@.  If we used @instance Fetchable ControlNode ()@ instead, then that</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- expression would be ambiguous without explicitly specifying the return type.</span><span>
</span><span id="line-104"></span><span id="local-6989586621679166336"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679166336"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166336"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-105"></span><span>    </span><span id="local-6989586621679166333"><span class="annot"><span class="annottext">getFetch :: ControlNode -&gt; Build (Fetch a)
</span><a href="#local-6989586621679166333"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Fetch () -&gt; Build (Fetch a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(Fetch () -&gt; Build (Fetch a)) -&gt; Fetch () -&gt; Build (Fetch a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">() -&gt; Fetch ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span id="local-6989586621679166332"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166332"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-108"></span><span>    </span><span id="local-6989586621679166330"><span class="annot"><span class="annottext">getNodes :: ListOf f '[] -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166330"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set NodeName -&gt; Build (Set NodeName)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">Set NodeName
forall a. Set a
</span><span class="hs-identifier hs-var">Set.empty</span></span></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span id="local-6989586621679166327"><span id="local-6989586621679166328"><span id="local-6989586621679166329"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166329"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166328"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166329"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166327"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166329"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166328"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-glyph">:</span><span> </span><span class="annot"><a href="#local-6989586621679166327"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-111"></span><span>    </span><span id="local-6989586621679166325"><span class="annot"><span class="annottext">getNodes :: ListOf f (a : as) -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166325"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166324"><span class="annot"><span class="annottext">x :: f a
</span><a href="#local-6989586621679166324"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="TensorFlow.Types.html#%3A%2F"><span class="hs-operator hs-type">:/</span></a></span><span> </span><span id="local-6989586621679166322"><span class="annot"><span class="annottext">xs :: ListOf f as
</span><a href="#local-6989586621679166322"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Set NodeName -&gt; Set NodeName -&gt; Set NodeName)
-&gt; Build (Set NodeName)
-&gt; Build (Set NodeName)
-&gt; Build (Set NodeName)
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><span class="hs-identifier hs-var">liftA2</span></span><span> </span><span class="annot"><span class="annottext">Set NodeName -&gt; Set NodeName -&gt; Set NodeName
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Set a
</span><span class="hs-identifier hs-var">Set.union</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f a -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679166324"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ListOf f as -&gt; Build (Set NodeName)
forall t. Nodes t =&gt; t -&gt; Build (Set NodeName)
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">ListOf f as
</span><a href="#local-6989586621679166322"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span id="local-6989586621679166319"><span id="local-6989586621679166320"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679166320"><span class="hs-identifier hs-type">l</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><a href="TensorFlow.Types.html#List"><span class="hs-identifier hs-type">List</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166319"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679166320"><span class="hs-identifier hs-type">l</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-114"></span><span>    </span><span id="local-6989586621679166316"><span class="annot"><span class="annottext">getFetch :: ListOf f '[] -&gt; Build (Fetch l)
</span><a href="#local-6989586621679166316"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Fetch (List '[]) -&gt; Build (Fetch l)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(Fetch (List '[]) -&gt; Build (Fetch l))
-&gt; Fetch (List '[]) -&gt; Build (Fetch l)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">List '[] -&gt; Fetch (List '[])
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="annot"><span class="annottext">List '[]
forall (f :: * -&gt; *). ListOf f '[]
</span><a href="TensorFlow.Types.html#Nil"><span class="hs-identifier hs-var">Nil</span></a></span></span></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span id="local-6989586621679166309"><span id="local-6989586621679166310"><span id="local-6989586621679166311"><span id="local-6989586621679166312"><span id="local-6989586621679166313"><span id="local-6989586621679166314"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166314"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166313"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679166312"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166314"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166311"><span class="hs-identifier hs-type">ts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#List"><span class="hs-identifier hs-type">List</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166310"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166309"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Identity</span></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166314"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166313"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-glyph">:</span><span> </span><span class="annot"><a href="#local-6989586621679166311"><span class="hs-identifier hs-type">ts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166309"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166312"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-glyph">:</span><span> </span><span class="annot"><a href="#local-6989586621679166310"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-118"></span><span>    </span><span id="local-6989586621679166306"><span class="annot"><span class="annottext">getFetch :: ListOf f (t : ts) -&gt; Build (Fetch (ListOf i (a : as)))
</span><a href="#local-6989586621679166306"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166305"><span class="annot"><span class="annottext">x :: f a
</span><a href="#local-6989586621679166305"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="TensorFlow.Types.html#%3A%2F"><span class="hs-operator hs-type">:/</span></a></span><span> </span><span id="local-6989586621679166304"><span class="annot"><span class="annottext">xs :: ListOf f as
</span><a href="#local-6989586621679166304"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; List as -&gt; List (a : as))
-&gt; Fetch a -&gt; Fetch (List as) -&gt; Fetch (List (a : as))
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><span class="hs-identifier hs-var">liftA2</span></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679166303"><span class="annot"><span class="annottext">y :: a
</span><a href="#local-6989586621679166303"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679166302"><span class="annot"><span class="annottext">ys :: List as
</span><a href="#local-6989586621679166302"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679166303"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; List as -&gt; List (a : as)
forall a (as :: [*]). a -&gt; List as -&gt; List (a : as)
</span><a href="TensorFlow.Types.html#%2F%3A%2F"><span class="hs-operator hs-var">/:/</span></a></span><span> </span><span class="annot"><span class="annottext">List as
</span><a href="#local-6989586621679166302"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Fetch a -&gt; Fetch (List as) -&gt; Fetch (List (a : as)))
-&gt; BuildT Identity (Fetch a)
-&gt; BuildT Identity (Fetch (List as) -&gt; Fetch (List (a : as)))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">f a -&gt; BuildT Identity (Fetch a)
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679166305"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch (List as) -&gt; Fetch (List (a : as)))
-&gt; BuildT Identity (Fetch (List as))
-&gt; BuildT Identity (Fetch (List (a : as)))
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;*&gt;</span></span><span> </span><span class="annot"><span class="annottext">ListOf f as -&gt; BuildT Identity (Fetch (List as))
forall t a. Fetchable t a =&gt; t -&gt; Build (Fetch a)
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">ListOf f as
</span><a href="#local-6989586621679166304"><span class="hs-identifier hs-var">xs</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span id="local-6989586621679166299"><span id="local-6989586621679166300"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166300"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166299"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-121"></span><span>    </span><span id="local-6989586621679166297"><span class="annot"><span class="annottext">getNodes :: Tensor v a -&gt; Build (Set NodeName)
</span><a href="#local-6989586621679166297"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span id="local-6989586621679166295"><span class="annot"><span class="annottext">o :: v Output
</span><a href="#local-6989586621679166295"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Set NodeName
forall a. a -&gt; Set a
</span><span class="hs-identifier hs-var">Set.singleton</span></span><span> </span><span class="annot"><span class="annottext">(NodeName -&gt; Set NodeName)
-&gt; (Output -&gt; NodeName) -&gt; Output -&gt; Set NodeName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">Output -&gt; NodeName
</span><a href="TensorFlow.Output.html#outputNodeName"><span class="hs-identifier hs-var hs-var">outputNodeName</span></a></span><span> </span><span class="annot"><span class="annottext">(Output -&gt; Set NodeName)
-&gt; BuildT Identity Output -&gt; Build (Set NodeName)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">v Output -&gt; BuildT Identity Output
forall (v :: * -&gt; *) a. TensorKind v =&gt; v a -&gt; Build a
</span><a href="TensorFlow.Tensor.html#toBuild"><span class="hs-identifier hs-var">toBuild</span></a></span><span> </span><span class="annot"><span class="annottext">v Output
</span><a href="#local-6989586621679166295"><span class="hs-identifier hs-var">o</span></a></span></span></span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="annot"><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-type">fetchTensorVector</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679166445"><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679166444"><span class="annot"><a href="#local-6989586621679166444"><span class="hs-identifier hs-type">v</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorType"><span class="hs-identifier hs-type">TensorType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>                  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166444"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorData"><span class="hs-identifier hs-type">TensorData</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span id="fetchTensorVector"><span class="annot"><span class="annottext">fetchTensorVector :: Tensor v a -&gt; Build (Fetch (TensorData a))
</span><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-var hs-var">fetchTensorVector</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span id="local-6989586621679166291"><span class="annot"><span class="annottext">o :: v Output
</span><a href="#local-6989586621679166291"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-126"></span><span>    </span><span id="local-6989586621679166290"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679166290"><span class="hs-identifier hs-var">outputName</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Output -&gt; Text
</span><a href="TensorFlow.Build.html#encodeOutput"><span class="hs-identifier hs-var">encodeOutput</span></a></span><span> </span><span class="annot"><span class="annottext">(Output -&gt; Text) -&gt; BuildT Identity Output -&gt; BuildT Identity Text
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">v Output -&gt; BuildT Identity Output
forall (v :: * -&gt; *) a. TensorKind v =&gt; v a -&gt; Build a
</span><a href="TensorFlow.Tensor.html#toBuild"><span class="hs-identifier hs-var">toBuild</span></a></span><span> </span><span class="annot"><span class="annottext">v Output
</span><a href="#local-6989586621679166291"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-127"></span><span>    </span><span class="annot"><span class="annottext">Fetch (TensorData a) -&gt; Build (Fetch (TensorData a))
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="annot"><span class="annottext">(Fetch (TensorData a) -&gt; Build (Fetch (TensorData a)))
-&gt; Fetch (TensorData a) -&gt; Build (Fetch (TensorData a))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Set Text
-&gt; (Map Text TensorData -&gt; TensorData a) -&gt; Fetch (TensorData a)
forall a. Set Text -&gt; (Map Text TensorData -&gt; a) -&gt; Fetch a
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Set Text
forall a. a -&gt; Set a
</span><span class="hs-identifier hs-var">Set.singleton</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679166290"><span class="hs-identifier hs-var">outputName</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Map Text TensorData -&gt; TensorData a) -&gt; Fetch (TensorData a))
-&gt; (Map Text TensorData -&gt; TensorData a) -&gt; Fetch (TensorData a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679166288"><span class="annot"><span class="annottext">tensors :: Map Text TensorData
</span><a href="#local-6989586621679166288"><span class="hs-identifier hs-var">tensors</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-128"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679166287"><span class="annot"><span class="annottext">tensorData :: TensorData
</span><a href="#local-6989586621679166287"><span class="hs-identifier hs-var hs-var">tensorData</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map Text TensorData
</span><a href="#local-6989586621679166288"><span class="hs-identifier hs-var">tensors</span></a></span><span> </span><span class="annot"><span class="annottext">Map Text TensorData -&gt; Text -&gt; TensorData
forall k a. Ord k =&gt; Map k a -&gt; k -&gt; a
</span><span class="hs-operator hs-var">Map.!</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679166290"><span class="hs-identifier hs-var">outputName</span></a></span><span>
</span><span id="line-129"></span><span>            </span><span id="local-6989586621679166285"><span class="annot"><span class="annottext">expectedType :: DataType
</span><a href="#local-6989586621679166285"><span class="hs-identifier hs-var hs-var">expectedType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; DataType
forall a. TensorType a =&gt; a -&gt; DataType
</span><a href="TensorFlow.Types.html#tensorType"><span class="hs-identifier hs-var">tensorType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. HasCallStack =&gt; a
</span><span class="hs-identifier hs-var">undefined</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span>            </span><span id="local-6989586621679166282"><span class="annot"><span class="annottext">actualType :: DataType
</span><a href="#local-6989586621679166282"><span class="hs-identifier hs-var hs-var">actualType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TensorData -&gt; DataType
</span><a href="TensorFlow.Internal.FFI.html#tensorDataType"><span class="hs-identifier hs-var hs-var">FFI.tensorDataType</span></a></span><span> </span><span class="annot"><span class="annottext">TensorData
</span><a href="#local-6989586621679166287"><span class="hs-identifier hs-var">tensorData</span></a></span><span>
</span><span id="line-131"></span><span>            </span><span id="local-6989586621679166280"><span class="annot"><span class="annottext">badTypeError :: TensorData a
</span><a href="#local-6989586621679166280"><span class="hs-identifier hs-var hs-var">badTypeError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; TensorData a
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><span class="hs-identifier hs-var">error</span></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; TensorData a) -&gt; [Char] -&gt; TensorData a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="hs-string">&quot;Bad tensor type: expected &quot;</span></span><span>
</span><span id="line-132"></span><span>                                   </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="annottext">DataType -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="#local-6989586621679166285"><span class="hs-identifier hs-var">expectedType</span></a></span><span>
</span><span id="line-133"></span><span>                                   </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="hs-string">&quot;, got &quot;</span></span><span>
</span><span id="line-134"></span><span>                                   </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="annottext">DataType -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="#local-6989586621679166282"><span class="hs-identifier hs-var">actualType</span></a></span><span>
</span><span id="line-135"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="#local-6989586621679166285"><span class="hs-identifier hs-var">expectedType</span></a></span><span> </span><span class="annot"><span class="annottext">DataType -&gt; DataType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="#local-6989586621679166282"><span class="hs-identifier hs-var">actualType</span></a></span><span>
</span><span id="line-136"></span><span>               </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">TensorData a
</span><a href="#local-6989586621679166280"><span class="hs-identifier hs-var">badTypeError</span></a></span><span>
</span><span id="line-137"></span><span>               </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">TensorData -&gt; TensorData a
forall a. TensorData -&gt; TensorData a
</span><a href="TensorFlow.Types.html#TensorData"><span class="hs-identifier hs-var">TensorData</span></a></span><span> </span><span class="annot"><span class="annottext">TensorData
</span><a href="#local-6989586621679166287"><span class="hs-identifier hs-var">tensorData</span></a></span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="hs-comment">-- The constraint &quot;a ~ a'&quot; means that the input/output of fetch can constrain</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- the TensorType of each other.</span><span>
</span><span id="line-141"></span><span id="local-6989586621679166273"><span id="local-6989586621679166274"><span id="local-6989586621679166275"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorType"><span class="hs-identifier hs-type">TensorType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166275"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166275"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><a href="#local-6989586621679166274"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166273"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166275"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorData"><span class="hs-identifier hs-type">TensorData</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166274"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-142"></span><span>    </span><span id="local-6989586621679166270"><span class="annot"><span class="annottext">getFetch :: Tensor v a -&gt; Build (Fetch (TensorData a'))
</span><a href="#local-6989586621679166270"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tensor v a -&gt; Build (Fetch (TensorData a'))
forall a (v :: * -&gt; *).
TensorType a =&gt;
Tensor v a -&gt; Build (Fetch (TensorData a))
</span><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-var">fetchTensorVector</span></a></span></span></span></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span id="local-6989586621679166266"><span id="local-6989586621679166267"><span id="local-6989586621679166268"><span id="local-6989586621679166269"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorType"><span class="hs-identifier hs-type">TensorType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Types.html#TensorDataType"><span class="hs-identifier hs-type">TensorDataType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166268"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><a href="#local-6989586621679166267"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166266"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166268"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166267"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-145"></span><span>    </span><span id="local-6989586621679166263"><span class="annot"><span class="annottext">getFetch :: Tensor v a -&gt; Build (Fetch (s a'))
</span><a href="#local-6989586621679166263"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span id="local-6989586621679166262"><span class="annot"><span class="annottext">t :: Tensor v a
</span><a href="#local-6989586621679166262"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TensorData a -&gt; s a) -&gt; Fetch (TensorData a) -&gt; Fetch (s a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="annot"><span class="annottext">TensorData a -&gt; s a
forall (s :: * -&gt; *) a. TensorDataType s a =&gt; TensorData a -&gt; s a
</span><a href="TensorFlow.Types.html#decodeTensorData"><span class="hs-identifier hs-var">decodeTensorData</span></a></span><span> </span><span class="annot"><span class="annottext">(Fetch (TensorData a) -&gt; Fetch (s a))
-&gt; BuildT Identity (Fetch (TensorData a))
-&gt; BuildT Identity (Fetch (s a))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">Tensor v a -&gt; BuildT Identity (Fetch (TensorData a))
forall a (v :: * -&gt; *).
TensorType a =&gt;
Tensor v a -&gt; Build (Fetch (TensorData a))
</span><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-var">fetchTensorVector</span></a></span><span> </span><span class="annot"><span class="annottext">Tensor v a
</span><a href="#local-6989586621679166262"><span class="hs-identifier hs-var">t</span></a></span></span></span></span></span><span>
</span><span id="line-146"></span></pre></body></html>